<template>
  <div class="div_login_body">
    <van-form @submit="onSubmit">
      <van-row style="margin: 16px;" gutter="10">

        <van-col span="24">
          <van-button round block type="info" :loading ="submitLoading" native-type="submit">
            立即登录
          </van-button>
        </van-col>
      </van-row>
      <van-row style="margin: 16px;">
        <van-col span="24" style="margin-top:4px">
          <van-button round block native-type="button" to="register">
            注册
          </van-button>
        </van-col>
      </van-row>
      <van-row style="margin: 16px;">
        <van-col span="24" style="margin-top:4px">
          <van-button round block native-type="button" to="rpswd">
            忘记密码
          </van-button>
        </van-col>
      </van-row>
    </van-form>
  </div>
</template>
<script>
  import {
    Form,
    Field,
    Button,
    Toast,
    Row,
    Col
  } from 'vant';

  export default {
    name: "Login",
    components: {
      'van-form': Form,
      'van-field': Field,
      'van-button': Button,
      'van-row': Row,
      'van-col': Col
    },
    data: function () {
      return {
        submitLoading:false
      }
    },
    methods: {
      //提交登录
      onSubmit(values) {
        this.submitLoading=true;
        this.$oidcClient.signIn();
        this.submitLoading=false;
      }
    },
    mounted() {
      //显示底部栏
      this.$store.commit('updateShowFoot', false)
    }
  }

</script>
<style scoped>
  .div_login_body {
    margin-top: 50%;
  }

</style>
